import axios from 'axios';

const mockRequest =axios.create({
  baseURL:'/mock',
  timeout:500
})

mockRequest.interceptors.request.use(config => {
  return config
},error => {
  return Promise.reject('请求超时')
})

mockRequest.interceptors.response.use(response => {
  return response.data
},error => {
  return Promise.reject('请求失败')
})

export default mockRequest;